@extends('front.common.header')

@section('title','充电加油')

@section('content')
<div class="main">
    <div class="banner" onMouseOver="preNextShow()" onMouseOut="preNextHide()">
        <ul>
            @foreach($banners as $banner)
            <li><img src="@if(count($banner->attachment->url)>0){{$banner->attachment->url}}@else{{ asset('/images/front/jyzn/bn.png') }}@endif" style=""></li>
            @endforeach
        </ul>
        <script type="text/javascript">
            $(function(){
                var slidey = $('.banner').unslider({
                  speed: 500,              
                  delay: 3000,          
                  complete: function() {}, 
                  keys: true,            
                  dots: true,             
                  fluid: false
                });
                data = slidey.data('unslider'); 
                data.move(2, function() {}); 
                $(".banner").css('width',"100%");
            })
        </script>
        <div class="employ-category">  
            
            <div style="width:1200px;height:475px;">
               <div class="unslider-arrow prev banner-previous hide fl"></div> 
               <div class="unslider-arrow next  banner-next hide fr"></div>   
            </div>
            
            <script type="text/javascript">
                var unslider = $('.banner').unslider();
                $('.unslider-arrow').click(function() {
                    var fn = this.className.split(' ')[1];
                     //  Either do unslider.data('unslider').next() or .prev() depending on the className
                    unslider.data('unslider')[fn]();
                 });
                 function preNextShow(){
                    $(".unslider-arrow").removeClass('hide');
                 }
                 function preNextHide(){
                    $(".unslider-arrow").addClass('hide');
                 }
            </script>   
        </div>
    </div>
</div>

    <!--页面内容开始-->
    <div class="content_bg">
        <div class="content">
            <!--左边-->
            <div class="content-left fl">
                <!--热门课程-->
                <div class="rm">
                    <span class="rm_more">热门课程
                        <a href="{{url('/teaches/list/1')}}">
                            <count>更多&nbsp;<img src="{{ asset('/images/front/jyz/more.png') }}"></count>
                        </a> 
                    </span>
                    @foreach($teachots as $key=>$hots)
                    <div class="tp fl ml9 @if($key == 0) ml12 @endif">
                        <a href="{{url('/teaches/'.$hots->id)}}">
                            <img src="@if(count($hots->attachment)>0){{ image_resize($hots->attachment->url,220,136) }}@else{{asset('/images/t-nopic.jpg')}}@endif">
                            <p class="jq">{{str_limit($hots->name,21)}}</p>
                        </a>
                        <p>
                            <a href="{{url('/teaches/'.$hots->id)}}"><span class="mf">{{ $hots->price == 0 ? '免费' : $hots->price.'积分' }}</span></a>
                            <span>|</span>
                            <a href="{{url('/teaches/'.$hots->id)}}"><span class="wxw">{{$hots->user->name}}</span></a>
                        </p>   
                    </div>
                    @endforeach
                </div>
            @if( count($teaches) > 0 )
            <div class="li_bg">
                <div class="li">
                    <span class="li_more">职业技能
                        <a href="{{url('/teaches/list/1')}}">
                            <count>更多&nbsp;<img src="{{asset('/images/front/jyz/more.png')}}"></count>
                        </a>
                    </span>
                    <div class="ct fl">
                        <div class="down-title-first">能力 面试 交际</div>
                        <div class="down-title-first-2">你所不知道的事</div>
                        <div class="category-up-button">
                               <img src="{{ asset('/images/front/jyzn/UP.png')}}">
                               <a @if(empty($authuser)) href="javascript:void(0)" onclick="loginTips()"@else href="{{ url('/member/teaches/create') }} " target="_blank" @endif>
                                 <span class="font-18 color-green">我要投稿</span>
    					       </a>
                        </div>
                    </div>
                    @foreach($teaches as $teach)
                    <div class="tp fl">
                        <a href="{{ url('/teaches/'.$teach->id)}}">
                            <img src="@if(count($teach->attachment)>0){{ image_resize($teach->attachment->url,220,136)}}@else{{asset('/images/t-nopic.jpg')}}@endif">
                            <p class="jq">{{str_limit($teach->name,21)}}</p>
                        </a>
                        <p>
                            <a href="{{ url('/teaches/'.$teach->id)}}"><span class="mf">{{ $teach->price == 0 ? '免费' : $teach->price.'积分' }}</span></a>
                            <span>|</span>
                            <a href="{{ url('/teaches/'.$teach->id)}}"><span class="wxw">{{ $teach->user->name }}</span></a>
                        </p>   
                    </div>
                    @endforeach
                    
                </div>
            </div>
            @endif
            @if( count($companys) > 0 )
            <div class="li_bg">
                <div class="li">
                    <span class="li_more">企业专区
                        <a href="{{url('/teaches/list/3')}}">
                            <count>更多&nbsp;<img src="{{ asset('/images/front/jyz/more.png') }}"></count>
                        </a>
                    </span>
                    <div class="ct1 fl">
                        <div class="down-title-second">名企一网打尽</div>
                        <div class="down-title-second-2">有能力就马上行动吧</div>
                    </div>
                    @foreach($companys as $company)
                    <div class="tp fl">
                        <a href="{{ url('/teaches/company/'.$company->id)}} ">
                            <img src="{{ image_resize($company->logo,220,136)}}">
                            <p class="jq">{{ str_limit($company->name,21) }}</p>
                        </a>
                        <p>
                            <a href="{{ url('/teaches/company/'.$company->id)}} ">职位：<span class="mf">{{count($company->jobsinfo)?:0}}</span></a>
                            <span>|</span>
                            <a href="{{ url('/teaches/company/'.$company->id)}} ">课程：<span class="wxw">{{count($company->teaches)?:0}}</span></a>
                        </p> 
                    </div>
                    @endforeach
                </div>
            </div>
            @endif
            @if(count($organization) > 0 )
            <div class="li_bg">
                <div class="li">
                    <span class="li_more">推荐机构
                        <a href="{{url('/teaches/list/2')}}">
                            <count>更多&nbsp;<img src="{{ asset('/images/front/jyz/more.png') }}"></count>
                        </a>
                    </span>
                    <div class="ct2 fl">
                        <div class="down-title-third">百万机构任你来挑</div>
                        <div class="down-title-third-2">更多机构精彩推荐</div>
                    </div>
    
                    @foreach($organization as $org)
                    <div class="tp fl">
                        <a href="{{ url('/teaches/organization/'.$org->id)}}">
                            <img src="@if(count($org->attachment)>0){{image_resize($org->attachment->url,220,136)}}@else{{asset('/images/t-nopic.jpg')}}@endif">
                            <p class="jq">{{ str_limit($org->name,21) }}</p>
                        </a>
                        <p>
                            <a href="{{ url('/teaches/organization/'.$org->id)}}">课程数：<span class="mf">{{ count($org->allclass) }}</span></a>
                            <span>|</span>
                            <a href="{{ url('/teaches/organization/'.$org->id)}}"><span class="wxw">{{ count($org->cityName)?$org->cityName->title:'南京' }}</span></a>
                        </p> 
                    </div>
                    @endforeach
                </div>
            </div>
            @endif
        </div>
        <!--右边-->

        <div class="content-right fr">
            <!--猜你喜欢-->
            <div class="xh">
                <span class="xh_list">猜你喜欢</span>
                @foreach($favemploy as $faves)
                <div>
                    <a href="{{url('/employ/'.$faves->id)}}">
                        <div class="way">{{$faves->title}}</div>
                        <div class="read">阅读({{$faves->reading_num ?: 0}})</div>
                    </a>
                </div>
                @endforeach
            </div>
            <!--1.课程排行职业-->
            @if(count($topteaches)>0)
            <div class="course_bg">
                <div class='course-hot'>课程排行</div>
                @foreach($topteaches as $key=>$ttop)
                <div onmouseover="changeShow({{$key}})" onmouseout="changehide({{$key}})" id="tipshots_{{$key}}">
                    <div class='course-title'>
                        <div class='course-shuzi @if(($key+1)==1) shuzi-bg1 @elseif(($key+1)==2) shuzi-bg2 @elseif(($key+1)==3) shuzi-bg3 @else shuzi-bg @endif'>{{$key+1}}</div>
                        <div class='course-wenzi'><a href="{{url('/teaches/'.$ttop->id)}}">{{ str_limit($ttop->name,21) }}</a></div>
                    </div>
                    <div class='course-content' @if($key==0) style='display:block;' @endif>
                        <div class="float-l">
                            <a href="{{url('/teaches/'.$ttop->id)}}">
                                <img class='course-img' src="@if(count($ttop->attachment)>0){{ image_resize($ttop->attachment->url,96,53)}}@else{{asset('/images/t-nopic.jpg')}}@endif"/>
                            </a>
                        </div>
                        <div class='course-vp'>
                            <div class='course-v'>
                                @if(($ttop->studys_num)>=1000)999+人 
                                @elseif($ttop->studys_num)  {{$ttop->studys_num}}人 
                                @elseif(!$ttop->studys_num) 0人
                                @endif
                            </div>
                            <div class='course-p'>
                                @if(($ttop->price)>=10000) 9999+积分 
                                @elseif($ttop->price) {{$ttop->price}}积分
                                @elseif(!$ttop->price) 免费 
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
                @endforeach     
            </div>
            @endif
            <!--2.课程排行企业-->
            @if(count($companytop)>0)
            <div class="course_bg">
                <div class='course-hot'>课程排行</div>
                @foreach($companytop as $key=>$ctop)
                <div onmouseover="changeShow1({{$key}})" onmouseout="changehide1({{$key}})" id="tipshots1_{{$key}}">
                    <div class='course-title'>
                        <div class='course-shuzi @if(($key+1)==1) shuzi-bg1 @elseif(($key+1)==2) shuzi-bg2 @elseif(($key+1)==3) shuzi-bg3 @else shuzi-bg @endif'>{{$key+1}}</div>
                        <div class='course-wenzi'>
                            <a href="{{url('/teaches/company/show/'.$ctop->id)}}">{{ str_limit($ctop->name,21) }}</a>
                       </div>
                    </div>
                    <div class='course-content course-content1'>
                        <div class="float-l">
                            <a href="{{url('/teaches/company/show/'.$ctop->id)}}">
                                <img class='course-img' src="@if(count($ctop->attachment)>0){{ image_resize($ctop->attachment->url,96,53)}}@else{{asset('/images/t-nopic.jpg')}}@endif"/>
                            </a>
                        </div>
                        <div class='course-vp'>
                            <div class='course-v'>
                                @if(($ctop->views_num)>=1000) 999+人 
                                @elseif($ctop->views_num)  {{$ctop->views_num}}人 
                                @elseif(!$ctop->views_num) 0人
                                @endif
                            </div>
                            <div class='course-p'>
                                @if(($ctop->price)>=10000) 9999+积分 
                                @elseif($ctop->price) {{$ttop->price}}积分
                                @elseif(!$ctop->price) 免费 
                                @endif
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
                @endforeach     
            </div>
            @endif
            <!--3.课程排行推荐-->
            @if(count($courHots)>0)
            <div class="course_bg">
                <div class='course-hot'>课程排行</div>
                @foreach($courHots as $key=>$courh)
                <div onmouseover="changeShow2({{$key}})" onmouseout="changehide2({{$key}})" id="tipshots2_{{$key}}">
                    <div class='course-title course-title2'>
                        <div class='course-shuzi @if(($key+1)==1) shuzi-bg1 @elseif(($key+1)==2) shuzi-bg2 @elseif(($key+1)==3) shuzi-bg3 @else shuzi-bg @endif'>{{$key+1}}</div>
                        <div class='course-wenzi'><a href="{{url('/teaches/orgcourse/'.$courh->id)}}">{{ str_limit($courh->name,21) }}</a></div>
                    </div>
                    <div class='course-content course-content2'>
                        <div class="float-l">
                            <a href="{{url('/teaches/orgcourse/'.$courh->id)}}">
                                <img class='course-img' src="@if(!empty($courh->attachment->url)){{image_resize($courh->attachment->url,96,53)}}@else{{asset('/images/t-nopic.jpg')}}@endif"/>
                            </a>
                        </div>
                        <div class='course-vp'>
                            <div class='course-v'>
                                @if(($courh->views)>=1000) 999+人 
                                @elseif($courh->views) {{$courh->views}}人 
                                @elseif(!$courh->views) 0人
                                @endif
                            </div>
                            <div class='course-p'>
                                @if(($courh->cost)>=10000) ¥9999+ 
                                @elseif($courh->cost)  {{$courh->cost}}积分 
                                @elseif(!$courh->cost) 免费 
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
                @endforeach      
            </div>
            @endif
            <script type="text/javascript">
            changeShow1(0);changeShow2(0);
                function changeShow(id){
                	$("#tipshots_"+id).parent().find(".course-content").hide();
                    $("#tipshots_"+id).find('.course-content').show();
                }
                function changehide(id){
                    $("#tipshots_"+id).find('.course-content').hide();
                    changeShow(0);
                }
                function changeShow1(id){
                	$("#tipshots1_"+id).parent().find(".course-content").hide();
                    $("#tipshots1_"+id).find('.course-content1').show();
                }
                function changehide1(id){
                    $("#tipshots1_"+id).find('.course-content1').hide();
                    changeShow1(0);
                }
                function changeShow2(id){
                	$("#tipshots2_"+id).parent().find(".course-content").hide();
                    $("#tipshots2_"+id).find('.course-content2').show();
                }
                function changehide2(id){
                    $("#tipshots2_"+id).find('.course-content2').hide();
                    changeShow2(0);
                }
            </script>
        </div>
    </div>
   </div>
@stop
